trigger lead_dedup on Lead bulk (before insert) {

 for (Lead l : Trigger.new){
     if (l.Email != NULL)
           {
                 Lead[] leads = [select id from lead where email = :l.Email];
                 if (leads.size() > 0) {
                       l.Email.addError('Lead cannot be created - Email already exists');
                 }
          
           }
     }


}